package com.tjsoft.system.util;

import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

public class AjaxUtil {
	
	  public static void ajaxWrite(Object ajaxData){
			HttpServletResponse response = ServletActionContext.getResponse();
			response.setCharacterEncoding("UTF-8");
			response.setContentType("html/txt");
			response.setHeader("Pragma", "no-cache");
			response.setHeader("Cache-Control", "no-cache, must-revalidate");
			response.setHeader("Pragma", "no-cache");
	        try {
				response.getWriter().write(ajaxData.toString());
				response.getWriter().flush();
				response.getWriter().close();
			} catch (Exception e) {
				e.getMessage();
			}
		}
}
